/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jkoa.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author fikri
 */
@Embeddable
public class KodDaerahPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "kod")
    private String kod;
    @Basic(optional = false)
    @Column(name = "kod_negeri")
    private String kodNegeri;

    public KodDaerahPK() {
    }

    public KodDaerahPK(String kod, String kodNegeri) {
        this.kod = kod;
        this.kodNegeri = kodNegeri;
    }

    public String getKod() {
        return kod;
    }

    public void setKod(String kod) {
        this.kod = kod;
    }

    public String getKodNegeri() {
        return kodNegeri;
    }

    public void setKodNegeri(String kodNegeri) {
        this.kodNegeri = kodNegeri;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (kod != null ? kod.hashCode() : 0);
        hash += (kodNegeri != null ? kodNegeri.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KodDaerahPK)) {
            return false;
        }
        KodDaerahPK other = (KodDaerahPK) object;
        if ((this.kod == null && other.kod != null) || (this.kod != null && !this.kod.equals(other.kod))) {
            return false;
        }
        if ((this.kodNegeri == null && other.kodNegeri != null) || (this.kodNegeri != null && !this.kodNegeri.equals(other.kodNegeri))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jkoa.model.KodDaerahPK[ kod=" + kod + ", kodNegeri=" + kodNegeri + " ]";
    }
    
}
